<template>
  <div>


    <el-table
      :data="pinions"
      border
      style="width: 100%">
      <el-table-column
        type="index"
        label="序号"
        width="50">
      </el-table-column>
      <el-table-column
        fixed
        label="属性"
        width="50">
        <template slot-scope="scope">
          <div v-if="scope.row.ispositive === 1">正面</div>
          <div v-if="scope.row.isneutral === 1">中性</div>
          <div v-if="scope.row.isnegative === 1">负面</div>
        </template>

        </el-table-column>
      <el-table-column
        label="标题">
        <template slot-scope="scope">
          <div v-html="scope.row.title"   style="font-weight: bold;text-overflow: ellipsis;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp:1;overflow: hidden;white-space:pre-wrap;">
          </div>
        </template>
      </el-table-column>
      <el-table-column
        label="日期与来源"
        width="220">
        <template slot-scope="scope">
          {{ scope.row.publishTime }}  {{ scope.row.siteName }}
        </template>

      </el-table-column>

    </el-table>

    <el-skeleton :rows="6" animated v-if="loading"/>

  </div>
</template>
<script>
import { queryByEventParameter, } from "@/api/system/event";
export default {
  props: {
    eventId: {
      type: Number,
      default: 0
    },
  },
  data() {
    return {
      loading: true,
      pinions:[],
      queryParams: {
      },
      pageParams: {
        pageNum: 1,
        pageSize: 10,
      },
    }
  },
  computed: {
  },
  watch: {},
  mounted() {

  },
  created() {
    this.getList()
  },
  methods: {
    /** 查询舆情清单列表 */
    getList() {
      this.loading = true;
      this.queryParams.eventId=this.eventId
      queryByEventParameter(this.queryParams, this.pageParams).then(response => {
        this.pinions = response.rows;
        this.loading = false;
      });
    },
  }
}
</script>
